package com.qianguo.buyer.widget.dropdownmenu;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

/**
 * Created by guxun on 16/3/1.
 */
public class MenuListFilterItem extends BaseMenuFilterItem implements Parcelable{
    public ArrayList<BaseMenuFilterItem> getChildren() {
        return children;
    }

    public void setChildren(ArrayList<BaseMenuFilterItem> children) {
        this.children = children;
    }

    private ArrayList<BaseMenuFilterItem> children;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        super.writeToParcel(dest, flags);
        dest.writeTypedList(children);
    }

    public MenuListFilterItem() {
    }

    protected MenuListFilterItem(Parcel in) {
        super(in);
        this.children = in.createTypedArrayList(BaseMenuFilterItem.CREATOR);
    }

    public static final Creator<MenuListFilterItem> CREATOR = new Creator<MenuListFilterItem>() {
        public MenuListFilterItem createFromParcel(Parcel source) {
            return new MenuListFilterItem(source);
        }

        public MenuListFilterItem[] newArray(int size) {
            return new MenuListFilterItem[size];
        }
    };

    @Override
    public String toString() {
        return "FilterItem{" +
                "children=" + children.toString() +
                '}';
    }
}
